|
|
|
The basic structure
is...WHILE(true) then execute all the code in the loop. The true represents a
boolean expression which could be x==1 or while(x!=7) (x does not equal 7).
It can be any combination of boolean statements that are legal. Even, (while
x==5 || v==7) which says execute the code while x equals five or while v
equals 7.
|
|
Comment to example:
|
|
1.Don't forget to declare variables
|
|
2.While x is less than 100 do
|
|
3. x++; Adds 1 to x every time it repeats, in
for loops the loop structure allows this to be done in the
structure
|